home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 March: Reference Library / Dev.CD Mar 97 RL.toast / mac / Technical Documentation / develop / develop Issue 28 / develop Issue 28 code / MacApp Debugging / TwistDownLists / UVolumeBasedApp.h < prev   
Encoding:
Text File  |  1996-07-15  |  3.0 KB  |  76 lines  |  [TEXT/MPS ]

  1. //----------------------------------------------------------------------------------------
  2. // UVolumeBasedApp.h
  3. // ETO20 MacApp 3.3.1, MPW 3.4.1
  4. // Copyright ©1996 Conrad Kopala
  5. // Twist Down Lists version 2.0a0 7/15/96
  6. //----------------------------------------------------------------------------------------
  7.  
  8. #ifndef __UVOLUMEBASEDAPP__
  9. #define __UVOLUMEBASEDAPP__
  10.  
  11. #ifndef __UVOLUME__
  12. #include "UVolume.h"
  13. #endif
  14.  
  15. // MacApp
  16. #ifndef __UOBJECT__
  17. #include "UObject.h"
  18. #endif
  19.  
  20. //ToolBox stuff
  21. //None
  22.  
  23. //ANSI stuff
  24. //None
  25.  
  26.  
  27. // First, read the commentary in UVolume.h because this file exists because I decided
  28. // it was necessary to use the TVolume object.
  29. //
  30. // MVolumeBasedApp contains methods paralleling TApplication's DoMakeFile, ChooseFile, 
  31. // CanOpenDocument, and OpenOld methods. The TApplication versions have been blatantly 
  32. // copied and modified to use a TVolume in place of TFile.
  33. //
  34. // One thing done here, is use TVolume::IsHFSVolume to verify that the volume is indeed
  35. // an HFS volume. If is not, we fail without opening anything and alert the user that he
  36. // attempted to open a non-HFS volume. 
  37. //
  38. // Two versions of ChooseVolume and OpenVolume are included. This is an artifact of the
  39. // development process. The simple versions of ChooseVolume and OpenVolume were written
  40. // first and then the more complicated versions were written. I saw no reason to remove
  41. // the old, simple versions of these methods. Sometimes, when trying to find mistakes in
  42. // a program it is useful to have more than one way of doing something and be able to
  43. // compare the results. Furthermore, it seems wasteful to throw working methods away - who
  44. // knows, they might turn out to be useful at a later date.
  45. //
  46. // The old versions accept an instance of TVolume while the new versions accept a list of 
  47. // aliases of disks. TOVolumeCommand parallels TODocCommand and uses the new versions.
  48. // TOpenVolumeCommand uses the old versions. The old versions have not been used for quite
  49. // some time so use them at your own risk.
  50. //----------------------------------------------------------------------------------------
  51. // MVolumeBasedApp
  52. //----------------------------------------------------------------------------------------
  53.  
  54. class MVolumeBasedApp
  55. {
  56.     MA_DECLARE_CLASS;
  57.     
  58. public:
  59.  
  60. MVolumeBasedApp::MVolumeBasedApp();
  61.  
  62. virtual ~MVolumeBasedApp();
  63.  
  64. TVolume* MVolumeBasedApp::DoMakeVolume();    //analog of DoMakeFile
  65.  
  66. Boolean MVolumeBasedApp::ChooseVolume(CommandNumber itsCommandNumber, TList** aVolumeList);    //analog of ChooseDocument
  67. Boolean MVolumeBasedApp::ChooseVolume(CommandNumber itsCommandNumber, TVolume** aVolume);    //old version
  68.  
  69. //Note: I could have overloaded CanOpenDocument and left it as a method of TTwistDownApp.
  70. Boolean MVolumeBasedApp::CanOpenVolume(CommandNumber itsCommandNumber, TVolume* aVolume);    //analog of CanOpenDocument
  71.  
  72. TDocument* MVolumeBasedApp::OpenVolume(CommandNumber itsOpenCommand, TList* aVolumeList);    //analog of OpenOld
  73. TDocument* MVolumeBasedApp::OpenVolume(CommandNumber itsOpenCommand, TVolume* volumeOwnedByDoc); //old version
  74. };
  75.  
  76. #endif